package com.mianshi;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class meituan {

//    static Set<String> set = new HashSet<>();
    static boolean flag;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        in.nextLine();
        for(int i = 0; i < num; i++){
//            set.clear();
            flag = false;
            String s = in.nextLine();
            char[] arr = s.toCharArray();
//            calculate(arr, 0, arr.length-1);
//            boolean flag = false;
//            for(String item : set){
//                if(!checked(item)){
//                    flag = true;
//                    break;
//                }
//            }

            if(flag == true){
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

    public static void calculate(char[] arr, int from, int to){
        if(arr == null || from >to || from < 0){
            return;
        }
        if(from == to){
//            set.add(String.valueOf(arr));
            if(!checked(String.valueOf(arr))){
                flag = true;
                return;
            }
        }
        for(int i = from; i <= to; i++){
            swap(arr, i, from);
            calculate(arr, from+1, to);
            swap(arr,i,from);
        }
    }

    public static void swap(char[] arr, int left, int right){
        char temp = arr[left];
        arr[left] = arr[right];
        arr[right] = temp;
    }

    public static boolean checked(String s){
        int n = s.length();
        int left = 0, right = n -1;
        while(left <= right){
            if(left != right){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
